package com.example.shop.order.dto;

import com.example.shop.common.bo.Page;
import com.example.shop.order.enums.OrderState;
import lombok.Data;

@Data
public class OrderQueryParam {
    public static final String QUERY_SQL =
            " " +
            "<if test='ew.orderId != null'>" +
                "order_id = ${ew.orderId} and " +
            "</if>" +
            "<if test='ew.buyLikeName != null'>" +
                "user_purchased_goods_class like '%${ew.buyLikeName}%' and " +
            "</if>" +
            "<if test='ew.orderState != null'>" +
                "order_state = ${ew.orderState.getOrderState()} and " +
            "</if>" +
            "1 " +
            "limit ${(ew.page.pageIndex-1)*ew.page.pageSize},${ew.page.pageSize}";
    private Long orderId;
    private String buyLikeName;
    private OrderState orderState;
    private Page page = new Page(1);
}
